<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
<script type="text/javascript">
	function check(id){
		var taget=document.getElementById(id);
		if(taget.disabled="disabled"){
			taget.disabled="";
		}else if(taget.disabled=""){
			alert("else");
			taget.disabled="disabled";
		}
	}
</script>
</head>
<body>
<div id="main" style="width:100%" align="center">
<div>
<s:form action="orderAction!addOrder" namespace="/retailer" name="f" method="post" onsubmit="return false;">
<table width="90%" align="center"  border="1" cellpadding="0" cellspacing="0">
  <tr>
    <td height="33" colspan="5" align="center">采购订单</td>
  </tr>
  <tr>
    <td width="20%" height="39" align="center"><div align="center">代理商</div></td>
    <td width="20%"><div align="center">产品名称</div></td>
    <td width="20%"><div align="center">底价</div></td>
    <td width="20%"><div align="center">金额</div></td>
    <td width="20%"><div align="center">数量</div></td>
  </tr>
  <s:iterator value="#request.productMap" var="promap" status="li">
  <s:hidden name="orders[%{#li.index}].fromUserId" value=""></s:hidden>
  <s:hidden name="orders[%{#li.index}].toUserId" value="%{#promap.key.userId}"></s:hidden>
	  <tr align="center">
	    <td><s:property value="#promap.key.userName"/></td>
	    <td colspan="4">
	    	<table width="100%" border="1" cellpadding="0" cellspacing="0"
	    			 style="border-top:none;border-left:none; border-right:none; border-bottom:none;">
	    	   <s:iterator value="#promap.value" var="p" status="num">
	    	   <s:hidden name="orders[%{#li.index}].orderinfoes[%{#num.index}].product.productId" value="%{#p.productId}"></s:hidden>
	        	<tr align="center">
	            	<td width="25%">
                    	<table width="100%" border="0">
                          <tr>
                            <td width="35%" align="center">
                            	<input style="margin-left:10px;" align="left" type="checkbox"/>
                            </td>
                            <td width="65%" align="left"><s:property value="#p.productName"/></td>
                          </tr>
                        </table>
	            	</td>
	                <td width="25%"><s:property value="#p.productionCost"/></td>
	                <td width="25%"><s:textfield name="orders[%{#li.index}].orderinfoes[%{#num.index}].productPrice" size="3" theme="simple" />元</td>
	                <td width="25%"><s:textfield name="orders[%{#li.index}].orderinfoes[%{#num.index}].productCount" size="3" theme="simple" /></td>
	            </tr>
	           </s:iterator>
	        </table>
	    </td>
	  </tr>
  </s:iterator>
</table>
</s:form>
</div>
<div id="bottom" style="margin-top:20px;">
	<input type="button" value="提交" onClick="document.f.submit();"/>
</div>
</div><!--end main-->
</body>
</html>